1.5.7. Running the Examples
The steps required to run the example are as follows:
Run the setup.cmd script from the command prompt with Administrator privileges, as shown in Figure 4.
On
successful completion of the command, the setup.cmd script outputs the
token policy key and the issuer key required by the web service and the
web service client, respectively. The web service requires the token
policy key to validate the trusted source of the SWT token. The web
service client requires the issuer key to register itself as the issuer
of input SWT tokens. In the Program.cs file in the Service project,
copy and paste the token policy key into the trustedTokenPolicyKey:
const string trustedTokenPolicyKey = "8O++r46Eo6e6VhGQaHSCfINhYMMCu14xsAectW2EFfk=";
Similarly, copy and paste the issuer key into the issuerKey variable in Program.cs file in the Client project:
issuerKey = "iEVAlclelnAsLoF4mn61PGH/xo1DR8l7F6bOAu6Pb1o=";
Start the service application (see Figure 5).
Start the client application (see Figure 6).
As shown in Figure 6,
the call to EncodeString() fails with an unauthorized exception when
executed in the context of a User role as a group claim, whereas all
the methods are executed when executed in the context of an
Administrator role as a group claim. This demonstrates the claims-based
identity model with ACS as the claims-transformation engine between the
client and the web service.